    <?php
	if(!Zalogowany() || !CzyAdmin())
	{
	    HtmlFooter();
	    exit;
	}
	
	$uploaddirpdf = "/home/pcaban/public_html/ki/.pdf/";
	$uploaddirrozw = "/home/pcaban/public_html/ki/.rozw/";
	$uploaddirin = "/home/pcaban/checker/.in/";
	$uploaddirout = "/home/pcaban/checker/.out/";
	
	if(isset($userfile1)){
	    if(move_uploaded_file($_FILES['userfile1']['tmp_name'],$uploaddirpdf.$_FILES['userfile1']['name'])){
		chmod($uploaddirpdf.$_FILES['userfile1']['name'],0644);
		echo("Wysylanie pliku <b>".$_FILES['userfile1']['name']."</b> powiodlo sie!<br>");
	    }else{
		echo("Error sending file <b>".$_FILES['userfile1']['name']."<b>!<br>");
		print_r($_FILES);
	    }
	}
    ?>
    Wysylanie tresci zadania:<br />
    <form enctype="multipart/form-data" action="index.php?page=ftp.php" method="post">
	<!--<input type="hidden" name="MAX_FILE_SIZE" value="100000">-->
	<input name="userfile1" type="file"><br>
	<input type="submit" value="Send Files">
	<!--<input type="reset" value="Reset Form">-->
    </form>
    <hr />
    <?php
	if(isset($userfile2)){
	    if(move_uploaded_file($_FILES['userfile2']['tmp_name'],$uploaddirrozw.$_FILES['userfile2']['name'])){
		chmod($uploaddirrozw.$_FILES['userfile2']['name'],0644);
		echo("Wysylanie pliku <b>".$_FILES['userfile2']['name']."</b> powiodlo sie!<br>");
	    }else{
		echo("Error sending file <b>".$_FILES['userfile2']['name']."<b>!<br>");
		print_r($_FILES);
	    }
	}
    ?>
    Wysylanie kodu zadania:<br />
    <form enctype="multipart/form-data" action="index.php?page=ftp.php" method="post">
	<input name="userfile2" type="file"><br>
	<input type="submit" value="Send Files">
    </form>
    <hr />    
    <?php
	if(isset($userfile3) && isset($inout)){
	    $localdir=($inout=="in"?$uploaddirin:$uploaddirout);
	    if($zadanie!="")
	    {
		$localdir.=$zadanie."/";
		mkdir($localdir);
	    }
	    if(move_uploaded_file($_FILES['userfile3']['tmp_name'],$localdir.$_FILES['userfile3']['name'])){
		chmod($localdir.$_FILES['userfile3']['name'],0600);
		echo("Wysylanie pliku <b>".$_FILES['userfile3']['name']."</b> do katalogu <b>$localdir</b> powiodlo sie!<br>");
	    }else{
		echo("Error sending file <b>".$_FILES['userfile3']['name']."<b>!<br>");
		print_r($_FILES);
	    }
	}
    ?>
    Wysylanie testow do zadan:<br />
    <form enctype="multipart/form-data" action="index.php?page=ftp.php" method="post">
	<input type="radio" name="inout" value="in">in<br>
	<input type="radio" name="inout" value="out">out<br>
	<select name="zadanie">
	    <option value="">(wybierz zadanie)</option>
	<?php 
	    ListaZadan(); 
	?>
	</select><br>
	<input name="userfile3" type="file"><br>
	<input type="submit" value="Send Files">
    </form>
    